package com.ruoyi.query.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.query.entity.QueryDtl;
import com.ruoyi.query.mapper.QueryDtlMapper;
import com.ruoyi.query.service.QueryDtlService;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.Collection;

/**
 * <p>
 * 动态查询详细 服务实现类
 * </p>
 *
 * @author XiaShiLong
 * @since 2021-03-25
 */
@Service
public class QueryDtlServiceImpl extends ServiceImpl<QueryDtlMapper, QueryDtl> implements QueryDtlService {

    /**
     * 根据父级id删除
     *
     * @param queryId 查询id
     * @return boolean
     */
    @Override
    public boolean removeByQueryId(Long queryId) {
        return this.remove(Wrappers.<QueryDtl>lambdaQuery().eq(QueryDtl::getQueryId, queryId));
    }

    /**
     * 根据父级id删除
     *
     * @param queryIds 查询id
     * @return boolean
     */
    @Override
    public boolean removeByQueryId(Collection<? extends Serializable> queryIds) {
        return this.remove(Wrappers.<QueryDtl>lambdaQuery().in(QueryDtl::getQueryId, queryIds));
    }
}
